function validateForm() {
    const username = document.getElementById('username').value;
    const password = document.getElementById('password').value;
    const usernameError = document.querySelector('#username +.error-message');
    const passwordError = document.querySelector('#password +.error-message');

    let isValid = true;

    if (username!== 'root' && username!== 'Van' && username!== 'Sxh'&& username!== 'Tim'&& username!== 'Des'&& username!== 'Fxq') {
        usernameError.textContent = '用户名错误';
        usernameError.style.display = 'block';
        isValid = false;
    } else {
        usernameError.style.display = 'none';
    }

    if (password!== 'root') {
        passwordError.textContent = '密码错误';
        passwordError.style.display = 'block';
        isValid = false;
    } else {
        passwordError.style.display = 'none';
    }

    if (isValid) {
        window.location.href = "home-page.html";
    }
}